<?php


/**
 * Notes:
 * PROJECT_NAME : ERP v1.8 重构erp
 * User: 夏鱼儿<397072174@qq.com>
 * Date: 2024/6/6
 * Time: 10:28
 */

namespace app\service\traits\model\lines;

use app\company\model\CompanyGoodsStore;
use app\company\model\CompanyUserDividend;
use think\model\relation\BelongsTo;
use think\model\relation\HasMany;
use think\model\relation\HasOne;


/**
 * 公司
 * @property  CompanyGoodsStore $companyGoodsStore
 * @property  CompanyGoodsStore $companyGoodsStoreO
 * @property  CompanyGoodsStore $companyGoodsStores
 * @property  CompanyUserDividend $companyUserDividend
 * @property  CompanyUserDividend $companyUserDividends
 * @property  CompanyUserDividend $companyUserDividendO
 */
trait Company
{
    /**
     * 公司 - 商品 - 门店
     * @return belongsTo
     */
    public function companyGoodsStore(): belongsTo
    {
        return $this->belongsTo(CompanyGoodsStore::class);
    }

    /**
     * 公司 - 商品 - 门店
     * @return hasMany
     */
    public function companyGoodsStores(): hasMany
    {
        return $this->hasMany(CompanyGoodsStore::class);
    }

    /**
     * 公司 - 商品 - 门店
     * @return hasOne
     */
    public function companyGoodsStoreO(): hasOne
    {
        return $this->hasOne(CompanyGoodsStore::class);
    }


    /**
     * 管理员表-用户表-分红表
     * @return hasOne
     */
    public function companyUserDividendO(): hasOne
    {
        return $this->hasOne(CompanyUserDividend::class);
    }


    /**
     * 管理员表-用户表-分红表
     * @return hasMany
     */
    public function companyUserDividends(): hasMany
    {
        return $this->hasMany(CompanyUserDividend::class);
    }

    /**
     * 管理员表-用户表-分红表
     * @return BelongsTo
     */
    public function companyUserDividend(): BelongsTo
    {
        return $this->BelongsTo(CompanyUserDividend::class);
    }

}